package com.clas.liu.myapplication.view.activity.impl;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.clas.liu.myapplication.R;
import com.clas.liu.myapplication.presenter.impl.BasePresenter;
import com.clas.liu.myapplication.view.widget.MyImageView;
import com.github.chrisbanes.photoview.PhotoView;
import com.squareup.picasso.Picasso;

/**
 * 用于查看图片的activity
 * Created by liu on 2019/3/14.
 */

public class ImageViewActivity extends BaseActivity {

    private PhotoView imageView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_image_view);
        setStatusBarTransparent();
        init();
    }

    private void init() {
        findView();
        String url = getIntent().getStringExtra("url");
        if (url!=null) {
            Picasso.with(this).load(url).placeholder(R.mipmap.loading).error(R.mipmap.loading).into(imageView);
        }

    }

    private void findView() {
        imageView = findViewById(R.id.img);
    }

    @Override
    protected BasePresenter getPresenter() {
        return null;
    }
}
